<template>
	<DetailPage v-bind="detailConfig" :model="nowRowData" style="width: 100%; margin: 0 auto">
		<template v-slot:orgBedRecord>
			<ApldTable v-bind="tableConfig" :data="tableData"></ApldTable>
		</template>
	</DetailPage>
</template>

<script setup lang="ts">
import DetailPage from '@/views/aplid/DetailPage/index.vue'
import { detailConfig } from '../config'
import apiMod from '@/apiMod/index'
import { ApldTable } from '@/components/AplidCrud'

const props = defineProps<{
	nowRowData?: any
}>()

const tableData = ref([])

const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [
		{ label: '申请时间', prop: 'applyTime' },
		{
			label: '申请类型',
			prop: 'applyType',
			custome: 'tag',
			dicData: [
				{ label: '第一次申请', value: '1' },
				{ label: '第二次申请', value: '2' },
				{ label: '改护理型', value: '3' },
			],
		},
		{ label: '领取时间', prop: 'receiveTime' },
	],
}
const getInitData = () => {
	apiMod
		.view_dpOrgBedRecord_page({
			bedId: props.nowRowData.id,
			creditCode: props.nowRowData.creditCode,
		})
		.then((res) => {
      tableData.value = res.data.records
		})
}

onMounted(() => {
	getInitData()
})
</script>
